package cn.hdu.liang.initialization;

class Tree {
    int height;

    Tree() {
        System.out.println("planting a seedling");
        height = 0;
    }

    Tree(int initialHeight) {
        height = initialHeight;
        System.out.println("创建一个Tree类,height=" + height);
    }

    void info() {
        System.out.println("Tree 是 " + height);
    }

    void info(String s) {
        System.out.println(s + ": Tree is " + height);
    }

}

public class Overloading {
    public static void main(String[] args) {
        for(int i = 0; i < 5; i++) {
            Tree t = new Tree(i);
            t.info();
            t.info("overloaded method");
            System.out.println();

        }
        new Tree();
    }
}
